<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
	<head>
		<meta http-equiv="content-type" content="text/html; charset=utf-8" />
		<meta name="generator" content="JsDoc Toolkit" />
		
		<title>JsDoc Reference - pv.Layout.Force</title>

		<style type="text/css">
			/* default.css */
body
{
	font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif;
	width: 800px;
}

.header
{
	clear: both;
	background-color: #ccc;
	padding: 8px;
}

h1
{
	font-size: 150%;
	font-weight: bold;
	padding: 0;
	margin: 1em 0 0 .3em;
}

hr
{
	border: none 0;
	border-top: 1px solid #7F8FB1;
	height: 1px;
}

pre.code
{
	display: block;
	padding: 8px;
	border: 1px dashed #ccc;
}

#index
{
	margin-top: 24px;
	float: left;
	width: 160px;
	position: absolute;
	left: 8px;
	background-color: #F3F3F3;
	padding: 8px;
}

#content
{
	margin-left: 190px;
	width: 600px;
}

.classList
{
	list-style-type: none;
	padding: 0;
	margin: 0 0 0 8px;
	font-family: arial, sans-serif;
	font-size: 1em;
	overflow: auto;
}

.classList li
{
	padding: 0;
	margin: 0 0 8px 0;
}

.summaryTable { width: 100%; }

h1.classTitle
{
	font-size:170%;
	line-height:130%;
}

h2 { font-size: 110%; }
caption, div.sectionTitle
{
	background-color: #7F8FB1;
	color: #fff;
	font-size:130%;
	text-align: left;
	padding: 2px 6px 2px 6px;
	border: 1px #7F8FB1 solid;
}

div.sectionTitle { margin-bottom: 8px; }
.summaryTable thead { display: none; }

.summaryTable td
{
	vertical-align: top;
	padding: 4px;
	border-bottom: 1px #7F8FB1 solid;
	border-right: 1px #7F8FB1 solid;
}

/*col#summaryAttributes {}*/
.summaryTable td.attributes
{
	border-left: 1px #7F8FB1 solid;
	width: 140px;
	text-align: right;
}

td.attributes, .fixedFont
{
	line-height: 15px;
	color: #002EBE;
	font-family: "Courier New",Courier,monospace;
	font-size: 13px;
}

.summaryTable td.nameDescription
{
	text-align: left;
	font-size: 13px;
	line-height: 15px;
}

.summaryTable td.nameDescription, .description
{
	line-height: 15px;
	padding: 4px;
	padding-left: 4px;
}

.summaryTable { margin-bottom: 8px; }

ul.inheritsList
{
	list-style: square;
	margin-left: 20px;
	padding-left: 0;
}

.detailList {
	margin-left: 20px; 
	line-height: 15px;
}
.detailList dt { margin-left: 20px; }

.detailList .heading
{
	font-weight: bold;
	padding-bottom: 6px;
	margin-left: 0;
}

.light, td.attributes, .light a:link, .light a:visited
{
	color: #777;
	font-style: italic;
}

.fineprint
{
	text-align: right;
	font-size: 10px;
}
		</style>
	</head>

	<body>
<!-- ============================== header ================================= -->	
		<!-- begin static/header.html -->
		<div id="header">
</div>
		<!-- end static/header.html -->

<!-- ============================== classes index ============================ -->
		<div id="index">
			<!-- begin publish.classesIndex -->
			<div align="center"><a href="../index.html">Class Index</a>
| <a href="../files.html">File Index</a></div>
<hr />
<h2>Classes</h2>
<ul class="classList">
	
	<li><i><a href="../symbols/_global_.html">_global_</a></i></li>
	
	<li><a href="../symbols/Array.html">Array</a></li>
	
	<li><a href="../symbols/pv.html">pv</a></li>
	
	<li><a href="../symbols/pv.Anchor.html">pv.Anchor</a></li>
	
	<li><a href="../symbols/pv.Area.html">pv.Area</a></li>
	
	<li><a href="../symbols/pv.Bar.html">pv.Bar</a></li>
	
	<li><a href="../symbols/pv.Behavior.html">pv.Behavior</a></li>
	
	<li><a href="../symbols/pv.Behavior.drag.html">pv.Behavior.drag</a></li>
	
	<li><a href="../symbols/pv.Behavior.pan.html">pv.Behavior.pan</a></li>
	
	<li><a href="../symbols/pv.Behavior.point.html">pv.Behavior.point</a></li>
	
	<li><a href="../symbols/pv.Behavior.resize.html">pv.Behavior.resize</a></li>
	
	<li><a href="../symbols/pv.Behavior.select.html">pv.Behavior.select</a></li>
	
	<li><a href="../symbols/pv.Behavior.zoom.html">pv.Behavior.zoom</a></li>
	
	<li><a href="../symbols/pv.Color.html">pv.Color</a></li>
	
	<li><a href="../symbols/pv.Color.Hsl.html">pv.Color.Hsl</a></li>
	
	<li><a href="../symbols/pv.Color.Rgb.html">pv.Color.Rgb</a></li>
	
	<li><a href="../symbols/pv.Colors.html">pv.Colors</a></li>
	
	<li><a href="../symbols/pv.Constraint.html">pv.Constraint</a></li>
	
	<li><a href="../symbols/pv.Constraint.bound.html">pv.Constraint.bound</a></li>
	
	<li><a href="../symbols/pv.Constraint.collision.html">pv.Constraint.collision</a></li>
	
	<li><a href="../symbols/pv.Constraint.position.html">pv.Constraint.position</a></li>
	
	<li><a href="../symbols/pv.Dom.html">pv.Dom</a></li>
	
	<li><a href="../symbols/pv.Dom.Node.html">pv.Dom.Node</a></li>
	
	<li><a href="../symbols/pv.Dot.html">pv.Dot</a></li>
	
	<li><a href="../symbols/pv.Flatten.html">pv.Flatten</a></li>
	
	<li><a href="../symbols/pv.Force.html">pv.Force</a></li>
	
	<li><a href="../symbols/pv.Force.charge.html">pv.Force.charge</a></li>
	
	<li><a href="../symbols/pv.Force.drag.html">pv.Force.drag</a></li>
	
	<li><a href="../symbols/pv.Force.spring.html">pv.Force.spring</a></li>
	
	<li><a href="../symbols/pv.Format.html">pv.Format</a></li>
	
	<li><a href="../symbols/pv.Format.date.html">pv.Format.date</a></li>
	
	<li><a href="../symbols/pv.Format.number.html">pv.Format.number</a></li>
	
	<li><a href="../symbols/pv.Format.time.html">pv.Format.time</a></li>
	
	<li><a href="../symbols/pv.Geo.LatLng.html">pv.Geo.LatLng</a></li>
	
	<li><a href="../symbols/pv.Geo.Projection.html">pv.Geo.Projection</a></li>
	
	<li><a href="../symbols/pv.Geo.projections.html">pv.Geo.projections</a></li>
	
	<li><a href="../symbols/pv.Geo.scale.html">pv.Geo.scale</a></li>
	
	<li><a href="../symbols/pv.Geo.scale%23ticks.html">pv.Geo.scale#ticks</a></li>
	
	<li><a href="../symbols/pv.histogram.html">pv.histogram</a></li>
	
	<li><a href="../symbols/pv.histogram.Bin.html">pv.histogram.Bin</a></li>
	
	<li><a href="../symbols/pv.Image.html">pv.Image</a></li>
	
	<li><a href="../symbols/pv.Label.html">pv.Label</a></li>
	
	<li><a href="../symbols/pv.Layout.html">pv.Layout</a></li>
	
	<li><a href="../symbols/pv.Layout.Arc.html">pv.Layout.Arc</a></li>
	
	<li><a href="../symbols/pv.Layout.Bullet.html">pv.Layout.Bullet</a></li>
	
	<li><a href="../symbols/pv.Layout.Cluster.html">pv.Layout.Cluster</a></li>
	
	<li><a href="../symbols/pv.Layout.Cluster.Fill.html">pv.Layout.Cluster.Fill</a></li>
	
	<li><a href="../symbols/pv.Layout.Force.html">pv.Layout.Force</a></li>
	
	<li><a href="../symbols/pv.Layout.Grid.html">pv.Layout.Grid</a></li>
	
	<li><a href="../symbols/pv.Layout.Hierarchy.html">pv.Layout.Hierarchy</a></li>
	
	<li><a href="../symbols/pv.Layout.Horizon.html">pv.Layout.Horizon</a></li>
	
	<li><a href="../symbols/pv.Layout.Indent.html">pv.Layout.Indent</a></li>
	
	<li><a href="../symbols/pv.Layout.Matrix.html">pv.Layout.Matrix</a></li>
	
	<li><a href="../symbols/pv.Layout.Network.html">pv.Layout.Network</a></li>
	
	<li><a href="../symbols/pv.Layout.Network.Link.html">pv.Layout.Network.Link</a></li>
	
	<li><a href="../symbols/pv.Layout.Network.Node.html">pv.Layout.Network.Node</a></li>
	
	<li><a href="../symbols/pv.Layout.Pack.html">pv.Layout.Pack</a></li>
	
	<li><a href="../symbols/pv.Layout.Partition.html">pv.Layout.Partition</a></li>
	
	<li><a href="../symbols/pv.Layout.Partition.Fill.html">pv.Layout.Partition.Fill</a></li>
	
	<li><a href="../symbols/pv.Layout.Rollup.html">pv.Layout.Rollup</a></li>
	
	<li><a href="../symbols/pv.Layout.Stack.html">pv.Layout.Stack</a></li>
	
	<li><a href="../symbols/pv.Layout.Tree.html">pv.Layout.Tree</a></li>
	
	<li><a href="../symbols/pv.Layout.Treemap.html">pv.Layout.Treemap</a></li>
	
	<li><a href="../symbols/pv.Line.html">pv.Line</a></li>
	
	<li><a href="../symbols/pv.Mark.html">pv.Mark</a></li>
	
	<li><a href="../symbols/pv.Nest.html">pv.Nest</a></li>
	
	<li><a href="../symbols/pv.Panel.html">pv.Panel</a></li>
	
	<li><a href="../symbols/pv.Particle.html">pv.Particle</a></li>
	
	<li><a href="../symbols/pv.Quadtree.html">pv.Quadtree</a></li>
	
	<li><a href="../symbols/pv.Quadtree.Node.html">pv.Quadtree.Node</a></li>
	
	<li><a href="../symbols/pv.Rule.html">pv.Rule</a></li>
	
	<li><a href="../symbols/pv.Scale.html">pv.Scale</a></li>
	
	<li><a href="../symbols/pv.Scale.linear.html">pv.Scale.linear</a></li>
	
	<li><a href="../symbols/pv.Scale.log.html">pv.Scale.log</a></li>
	
	<li><a href="../symbols/pv.Scale.ordinal.html">pv.Scale.ordinal</a></li>
	
	<li><a href="../symbols/pv.Scale.quantile.html">pv.Scale.quantile</a></li>
	
	<li><a href="../symbols/pv.Scale.quantitative.html">pv.Scale.quantitative</a></li>
	
	<li><a href="../symbols/pv.Scale.root.html">pv.Scale.root</a></li>
	
	<li><a href="../symbols/pv.Simulation.html">pv.Simulation</a></li>
	
	<li><a href="../symbols/pv.Transform.html">pv.Transform</a></li>
	
	<li><a href="../symbols/pv.Tree.html">pv.Tree</a></li>
	
	<li><a href="../symbols/pv.Vector.html">pv.Vector</a></li>
	
	<li><a href="../symbols/pv.version.html">pv.version</a></li>
	
	<li><a href="../symbols/pv.Wedge.html">pv.Wedge</a></li>
	
</ul>
<hr />
			<!-- end publish.classesIndex -->
		</div>
		
		<div id="content">
<!-- ============================== class title ============================ -->
			<h1 class="classTitle">
				
				Class pv.Layout.Force
			</h1>

<!-- ============================== class summary ========================== -->			
			<p class="description">
				
				<br />Extends
					<a href="../symbols/pv.Layout.Network.html">pv.Layout.Network</a>.<br />
				
			
				Implements force-directed network layout as a node-link diagram. This
layout uses the Fruchterman-Reingold algorithm, which applies an attractive
spring force between neighboring nodes, and a repulsive electrical charge
force between all nodes. An additional drag force improves stability of the
simulation. See <a href="../symbols/pv.Force.spring.html">pv.Force.spring</a>, <a href="../symbols/pv.Force.drag.html">pv.Force.drag</a> and {@link
pv.Force.charge} for more details; note that the n-body charge force is
approximated using the Barnes-Hut algorithm.

<p>This layout is implemented on top of <a href="../symbols/pv.Simulation.html">pv.Simulation</a>, which can be
used directly for more control over simulation parameters. The simulation
uses Position Verlet integration, which does not compute velocities
explicitly, but allows for easy geometric constraints, such as bounding the
nodes within the layout panel. Many of the configuration properties supported
by this layout are simply passed through to the underlying forces and
constraints of the simulation.

<p>Force layouts are typically interactive. The gradual movement of the nodes
as they stabilize to a local stress minimum can help reveal the structure of
the network, as can <a href="../symbols/pv.Behavior.drag.html">pv.Behavior.drag</a>, which allows the user to pick
up nodes and reposition them while the physics simulation continues. This
layout can also be used with pan &amp; zoom behaviors for interaction.

<p>To facilitate interaction, this layout by default automatically re-renders
using a <tt>setInterval</tt> every 42 milliseconds. This can be disabled via
the <tt>iterations</tt> property, which if non-null specifies the number of
simulation iterations to run before the force-directed layout is finalized.
Be careful not to use too high an iteration count, as this can lead to an
annoying delay on page load.

<p>As with other network layouts, the network data can be updated
dynamically, provided the property cache is reset. See
<a href="../symbols/pv.Layout.Network.html">pv.Layout.Network</a> for details. New nodes are initialized with random
positions near the center. Alternatively, positions can be specified manually
by setting the <tt>x</tt> and <tt>y</tt> attributes on nodes.
				
				
					<br /><i>Defined in: </i> <a href="../symbols/src/src_layout_Force.js.html">Force.js</a>.
				
			</p>

<!-- ============================== constructor summary ==================== -->			
			
			<table class="summaryTable" cellspacing="0" summary="A summary of the constructor documented in the class pv.Layout.Force.">
				<caption>Class Summary</caption>
				<thead>
					<tr>
						<th scope="col">Constructor Attributes</th>
						<th scope="col">Constructor Name and Description</th>
					</tr>
				</thead>
				<tbody>
					<tr>
						<td class="attributes">&nbsp;</td>
						<td class="nameDescription" >
							<div class="fixedFont">
								<b><a href="../symbols/pv.Layout.Force.html#constructor">pv.Layout.Force</a></b>()
							</div>
							<div class="description">Constructs a new, empty force-directed layout.</div>
						</td>
					</tr>
				</tbody>
			</table>
			

<!-- ============================== properties summary ===================== -->
			
				
				
				<table class="summaryTable" cellspacing="0" summary="A summary of the fields documented in the class pv.Layout.Force.">
					<caption>Field Summary</caption>
					<thead>
						<tr>
							<th scope="col">Field Attributes</th>
							<th scope="col">Field Name and Description</th>
						</tr>
					</thead>
					<tbody>
					
						<tr>
							<td class="attributes">&nbsp;</td>
							<td class="nameDescription">
								<div class="fixedFont">
								<b><a href="../symbols/pv.Layout.Force.html#bound">bound</a></b>
								</div>
								<div class="description">The bound parameter; true if nodes should be constrained within the layout
panel.</div>
							</td>
						</tr>
					
						<tr>
							<td class="attributes">&nbsp;</td>
							<td class="nameDescription">
								<div class="fixedFont">
								<b><a href="../symbols/pv.Layout.Force.html#chargeConstant">chargeConstant</a></b>
								</div>
								<div class="description">The charge constant, which should be a negative number.</div>
							</td>
						</tr>
					
						<tr>
							<td class="attributes">&nbsp;</td>
							<td class="nameDescription">
								<div class="fixedFont">
								<b><a href="../symbols/pv.Layout.Force.html#chargeMaxDistance">chargeMaxDistance</a></b>
								</div>
								<div class="description">The maximum distance at which charge forces are applied.</div>
							</td>
						</tr>
					
						<tr>
							<td class="attributes">&nbsp;</td>
							<td class="nameDescription">
								<div class="fixedFont">
								<b><a href="../symbols/pv.Layout.Force.html#chargeMinDistance">chargeMinDistance</a></b>
								</div>
								<div class="description">The minimum distance at which charge forces are applied.</div>
							</td>
						</tr>
					
						<tr>
							<td class="attributes">&nbsp;</td>
							<td class="nameDescription">
								<div class="fixedFont">
								<b><a href="../symbols/pv.Layout.Force.html#chargeTheta">chargeTheta</a></b>
								</div>
								<div class="description">The Barnes-Hut approximation factor.</div>
							</td>
						</tr>
					
						<tr>
							<td class="attributes">&nbsp;</td>
							<td class="nameDescription">
								<div class="fixedFont">
								<b><a href="../symbols/pv.Layout.Force.html#defaults">defaults</a></b>
								</div>
								<div class="description">Default properties for force-directed layouts.</div>
							</td>
						</tr>
					
						<tr>
							<td class="attributes">&nbsp;</td>
							<td class="nameDescription">
								<div class="fixedFont">
								<b><a href="../symbols/pv.Layout.Force.html#dragConstant">dragConstant</a></b>
								</div>
								<div class="description">The drag constant, in the range [0,1].</div>
							</td>
						</tr>
					
						<tr>
							<td class="attributes">&nbsp;</td>
							<td class="nameDescription">
								<div class="fixedFont">
								<b><a href="../symbols/pv.Layout.Force.html#iterations">iterations</a></b>
								</div>
								<div class="description">The number of simulation iterations to run, or null if this layout is
interactive.</div>
							</td>
						</tr>
					
						<tr>
							<td class="attributes">&nbsp;</td>
							<td class="nameDescription">
								<div class="fixedFont">
								<b><a href="../symbols/pv.Layout.Force.html#springConstant">springConstant</a></b>
								</div>
								<div class="description">The spring constant, which should be a positive number.</div>
							</td>
						</tr>
					
						<tr>
							<td class="attributes">&nbsp;</td>
							<td class="nameDescription">
								<div class="fixedFont">
								<b><a href="../symbols/pv.Layout.Force.html#springDamping">springDamping</a></b>
								</div>
								<div class="description">The spring damping factor, in the range [0,1].</div>
							</td>
						</tr>
					
						<tr>
							<td class="attributes">&nbsp;</td>
							<td class="nameDescription">
								<div class="fixedFont">
								<b><a href="../symbols/pv.Layout.Force.html#springLength">springLength</a></b>
								</div>
								<div class="description">The spring rest length.</div>
							</td>
						</tr>
					
					</tbody>
				</table>
				
				
				
				<dl class="inheritsList">
				<dt>Fields borrowed from class <a href="../symbols/pv.Layout.Network.html">pv.Layout.Network</a>: </dt><dd><a href="../symbols/pv.Layout.Network.html#label">label</a>, <a href="../symbols/pv.Layout.Network.html#link">link</a>, <a href="../symbols/pv.Layout.Network.html#node">node</a></dd><dt>Fields borrowed from class <a href="../symbols/pv.Panel.html">pv.Panel</a>: </dt><dd><a href="../symbols/pv.Panel.html#canvas">canvas</a>, <a href="../symbols/pv.Panel.html#children">children</a>, <a href="../symbols/pv.Panel.html#overflow">overflow</a>, <a href="../symbols/pv.Panel.html#transform">transform</a></dd><dt>Fields borrowed from class <a href="../symbols/pv.Bar.html">pv.Bar</a>: </dt><dd><a href="../symbols/pv.Bar.html#fillStyle">fillStyle</a>, <a href="../symbols/pv.Bar.html#height">height</a>, <a href="../symbols/pv.Bar.html#lineWidth">lineWidth</a>, <a href="../symbols/pv.Bar.html#strokeStyle">strokeStyle</a>, <a href="../symbols/pv.Bar.html#width">width</a></dd><dt>Fields borrowed from class <a href="../symbols/pv.Mark.html">pv.Mark</a>: </dt><dd><a href="../symbols/pv.Mark.html#bottom">bottom</a>, <a href="../symbols/pv.Mark.html#childIndex">childIndex</a>, <a href="../symbols/pv.Mark.html#cursor">cursor</a>, <a href="../symbols/pv.Mark.html#data">data</a>, <a href="../symbols/pv.Mark.html#events">events</a>, <a href="../symbols/pv.Mark.html#index">index</a>, <a href="../symbols/pv.Mark.html#left">left</a>, <a href="../symbols/pv.Mark.html#parent">parent</a>, <a href="../symbols/pv.Mark.html#proto">proto</a>, <a href="../symbols/pv.Mark.html#reverse">reverse</a>, <a href="../symbols/pv.Mark.html#right">right</a>, <a href="../symbols/pv.Mark.html#root">root</a>, <a href="../symbols/pv.Mark.html#scale">scale</a>, <a href="../symbols/pv.Mark.html#title">title</a>, <a href="../symbols/pv.Mark.html#top">top</a>, <a href="../symbols/pv.Mark.html#type">type</a>, <a href="../symbols/pv.Mark.html#visible">visible</a></dd>
				</dl>
				
			

<!-- ============================== methods summary ======================== -->
			
				
				
				
				
				<dl class="inheritsList">
				<dt>Methods borrowed from class <a href="../symbols/pv.Layout.Network.html">pv.Layout.Network</a>: </dt><dd><a href="../symbols/pv.Layout.Network.html#reset">reset</a></dd><dt>Methods borrowed from class <a href="../symbols/pv.Panel.html">pv.Panel</a>: </dt><dd><a href="../symbols/pv.Panel.html#add">add</a>, <a href="../symbols/pv.Panel.html#anchor">anchor</a></dd><dt>Methods borrowed from class <a href="../symbols/pv.Mark.html">pv.Mark</a>: </dt><dd><a href="../symbols/pv.Mark.html#anchorTarget">anchorTarget</a>, <a href="../symbols/pv.Mark.html#def">def</a>, <a href="../symbols/pv.Mark.html#event">event</a>, <a href="../symbols/pv.Mark.html#extend">extend</a>, <a href="../symbols/pv.Mark.html#margin">margin</a>, <a href="../symbols/pv.Mark.html#mouse">mouse</a>, <a href="../symbols/pv.Mark.html#render">render</a></dd>
				</dl>
				
			
<!-- ============================== events summary ======================== -->
			

<!-- ============================== constructor details ==================== -->		
			
			<div class="details"><a name="constructor"> </a>
				<div class="sectionTitle">
					Class Detail
				</div>
				
				<div class="fixedFont">
						<b>pv.Layout.Force</b>()
				</div>
				
				<div class="description">
					Constructs a new, empty force-directed layout. Layouts are not typically
constructed directly; instead, they are added to an existing panel via
<a href="../symbols/pv.Mark.html#add">pv.Mark#add</a>.
					
				</div>
				
				
				
				
					
					
					
					
					
					
					
						<dl class="detailList">
						<dt class="heading">See:</dt>
						
							<dd><a href="http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.13.8444&rep=rep1&type=pdf"
>"Graph Drawing by Force-directed Placement"</a> by T. Fruchterman &amp;
E. Reingold, Software--Practice &amp; Experience, November 1991.</dd>
						
						</dl>
					

			</div>
			

<!-- ============================== field details ========================== -->		
			
				<div class="sectionTitle">
					Field Detail
				</div>
				
					<a name="bound"> </a>
					<div class="fixedFont">
					
					<span class="light">{boolean}</span>
					<b>bound</b>
					
					</div>
					<div class="description">
						The bound parameter; true if nodes should be constrained within the layout
panel. Bounding is disabled by default. Currently the layout does not observe
the radius of the nodes; strictly speaking, only the center of the node is
constrained to be within the panel, with an additional 6-pixel offset for
padding. A future enhancement could extend the bound constraint to observe
the node's radius, which would also support bounding for variable-size nodes.

<p>Note that if this layout is used in conjunction with pan &amp; zoom
behaviors, those behaviors should have their bound parameter set to the same
value.
						
						
					</div>
					
					

						
						
						
						

					<hr />
				
					<a name="chargeConstant"> </a>
					<div class="fixedFont">
					
					<span class="light">{number}</span>
					<b>chargeConstant</b>
					
					</div>
					<div class="description">
						The charge constant, which should be a negative number. The default value is
-40; more negative values will result in a stronger repulsive force, which
may lead to faster convergence at the risk of instability. Too strong
repulsive charge forces can cause comparatively weak springs to be stretched
well beyond their rest length, emphasizing global structure over local
structure. A nonnegative value will break the Fruchterman-Reingold algorithm,
and is for entertainment purposes only.
						
						
					</div>
					
					

						
						
						
							<dl class="detailList">
							<dt class="heading">See:</dt>
							
							<dd><a href="../symbols/pv.Force.charge.html#constant">pv.Force.charge#constant</a></dd>
							
							</dl>
						
						

					<hr />
				
					<a name="chargeMaxDistance"> </a>
					<div class="fixedFont">
					
					<span class="light">{number}</span>
					<b>chargeMaxDistance</b>
					
					</div>
					<div class="description">
						The maximum distance at which charge forces are applied. This improves
performance by ignoring weak charge forces at great distances. Note that this
parameter is partly redundant, as the Barnes-Hut algorithm for n-body forces
already improves performance for far-away particles through approximation.
						
						
					</div>
					
					

						
						
						
							<dl class="detailList">
							<dt class="heading">See:</dt>
							
							<dd><a href="../symbols/pv.Force.charge.html#domain">pv.Force.charge#domain</a></dd>
							
							</dl>
						
						

					<hr />
				
					<a name="chargeMinDistance"> </a>
					<div class="fixedFont">
					
					<span class="light">{number}</span>
					<b>chargeMinDistance</b>
					
					</div>
					<div class="description">
						The minimum distance at which charge forces are applied. The default minimum
distance of 2 avoids applying forces that are two strong; because the physics
simulation is run at discrete time intervals, it is possible for two same-
charged particles to become very close or even a singularity! Since the
charge force is inversely proportional to the square of the distance, very
small distances can break the simulation.

<p>In rare cases, two particles can become stuck on top of each other, as a
minimum distance threshold will prevent the charge force from repelling them.
However, this occurs very rarely because other forces and momentum typically
cause the particles to become separated again, at which point the repulsive
charge force kicks in.
						
						
					</div>
					
					

						
						
						
							<dl class="detailList">
							<dt class="heading">See:</dt>
							
							<dd><a href="../symbols/pv.Force.charge.html#domain">pv.Force.charge#domain</a></dd>
							
							</dl>
						
						

					<hr />
				
					<a name="chargeTheta"> </a>
					<div class="fixedFont">
					
					<span class="light">{number}</span>
					<b>chargeTheta</b>
					
					</div>
					<div class="description">
						The Barnes-Hut approximation factor. The Barnes-Hut approximation criterion
is the ratio of the size of the quadtree node to the distance from the point
to the node's center of mass is beneath some threshold. The default value is
0.9.
						
						
					</div>
					
					

						
						
						
							<dl class="detailList">
							<dt class="heading">See:</dt>
							
							<dd><a href="../symbols/pv.Force.charge.html#theta">pv.Force.charge#theta</a></dd>
							
							</dl>
						
						

					<hr />
				
					<a name="defaults"> </a>
					<div class="fixedFont">
					
					<span class="light">{<a href="../symbols/pv.Layout.Force.html">pv.Layout.Force</a>}</span>
					<b>defaults</b>
					
					</div>
					<div class="description">
						Default properties for force-directed layouts. The default drag constant is
0.1, the default charge constant is -40 (with a domain of [2, 500] and theta
of 0.9), and the default spring constant is 0.1 (with a damping of 0.3 and a
rest length of 20).
						
						
					</div>
					
					

						
						
						
						

					<hr />
				
					<a name="dragConstant"> </a>
					<div class="fixedFont">
					
					<span class="light">{number}</span>
					<b>dragConstant</b>
					
					</div>
					<div class="description">
						The drag constant, in the range [0,1]. A value of 0 means no drag (a
perfectly frictionless environment), while a value of 1 means friction
immediately cancels all momentum. The default value is 0.1, which provides a
minimum amount of drag that helps stabilize bouncy springs; lower values may
result in excessive bounciness, while higher values cause the simulation to
take longer to converge.
						
						
					</div>
					
					

						
						
						
							<dl class="detailList">
							<dt class="heading">See:</dt>
							
							<dd><a href="../symbols/pv.Force.drag.html#constant">pv.Force.drag#constant</a></dd>
							
							</dl>
						
						

					<hr />
				
					<a name="iterations"> </a>
					<div class="fixedFont">
					
					<span class="light">{number}</span>
					<b>iterations</b>
					
					</div>
					<div class="description">
						The number of simulation iterations to run, or null if this layout is
interactive. Force-directed layouts are interactive by default, using a
<tt>setInterval</tt> to advance the physics simulation and re-render
automatically.
						
						
					</div>
					
					

						
						
						
						

					<hr />
				
					<a name="springConstant"> </a>
					<div class="fixedFont">
					
					<span class="light">{number}</span>
					<b>springConstant</b>
					
					</div>
					<div class="description">
						The spring constant, which should be a positive number. The default value is
0.1; greater values will result in a stronger attractive force, which may
lead to faster convergence at the risk of instability. Too strong spring
forces can cause comparatively weak charge forces to be ignored, emphasizing
local structure over global structure. A nonpositive value will break the
Fruchterman-Reingold algorithm, and is for entertainment purposes only.

<p>The spring tension is automatically normalized using the inverse square
root of the maximum link degree of attached nodes.
						
						
					</div>
					
					

						
						
						
							<dl class="detailList">
							<dt class="heading">See:</dt>
							
							<dd><a href="../symbols/pv.Force.spring.html#constant">pv.Force.spring#constant</a></dd>
							
							</dl>
						
						

					<hr />
				
					<a name="springDamping"> </a>
					<div class="fixedFont">
					
					<span class="light">{number}</span>
					<b>springDamping</b>
					
					</div>
					<div class="description">
						The spring damping factor, in the range [0,1]. Damping functions identically
to drag forces, damping spring bounciness by applying a force in the opposite
direction of attached nodes' velocities. The default value is 0.3.

<p>The spring damping is automatically normalized using the inverse square
root of the maximum link degree of attached nodes.
						
						
					</div>
					
					

						
						
						
							<dl class="detailList">
							<dt class="heading">See:</dt>
							
							<dd><a href="../symbols/pv.Force.spring.html#damping">pv.Force.spring#damping</a></dd>
							
							</dl>
						
						

					<hr />
				
					<a name="springLength"> </a>
					<div class="fixedFont">
					
					<span class="light">{number}</span>
					<b>springLength</b>
					
					</div>
					<div class="description">
						The spring rest length. The default value is 20 pixels. Larger values may be
appropriate if the layout panel is larger, or if the nodes are rendered
larger than the default dot size of 20.
						
						
					</div>
					
					

						
						
						
							<dl class="detailList">
							<dt class="heading">See:</dt>
							
							<dd><a href="../symbols/pv.Force.spring.html#length">pv.Force.spring#length</a></dd>
							
							</dl>
						
						

					
				
			

<!-- ============================== method details ========================= -->		
			
			
<!-- ============================== event details ========================= -->		
			
			
			<hr />
		</div>

		
<!-- ============================== footer ================================= -->
		<div class="fineprint" style="clear:both">
			
			Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.3.2 on Fri May 28 2010 10:13:29 GMT-0700 (PDT)
		</div>
	</body>
</html>
